<template>
  <div class="box">
    <header>
      <div class="back" @click="$router.back(-1)">
        <Icon name="arrow-left"></Icon>
      </div>
      <div class="title">{{title}}</div>
      <i></i>
    </header>
    <main>
      <slot name="main"></slot>
    </main>
  </div>
</template>

<script>
import { Icon } from 'vant'
export default {
    components: {
        Icon
    },
    props: {
        title: {
            type: String
        }
    }
};
</script>

<style scoped lang='scss'>
@import "@/assets/scss/index.scss";
.box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  header {
    height: 0.5rem;
    width: 100%;
    display: flex;
    padding: 0 0.3rem;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center;
    .back {
      i {
        font-size: $font-size-xl;
      }
    }
    .title {
      font-size: $font-size-xl;
    }
  }
  main {
    background: #f5f5f5;
    flex: 1;
    overflow: auto;
  }
}
</style>
